package com.cxy.instarsystem.web;

import com.cxy.instarsystem.service.NewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class IndexController {

    @Autowired
    private NewsService newsService;

    @GetMapping("/")
    public String index(Model model){
        model.addAttribute("news",newsService.listTypeTop(7));
        return "index";
    }



}
